<template>
  <div>
    <DoctorHeader :titleText="'窗口收费'"/>
    <el-divider />
    <h3>患者信息查询</h3>
    <div class="ly-filter">    <!--keydown 键盘录入事件-->
      <el-input placeholder="请输入病历号" v-model="query.caseNumber" @keydown="search"></el-input>
      <el-button type="primary" @click="getTableData">搜索</el-button>
     </div>
     <el-divider />
    <h3>患者信息确认</h3>
    <el-form style="margin: 20px 0;" inline label-width="80px">
      <el-form-item label="患者姓名">{{result.register.realName}}</el-form-item>
      <el-form-item label="身份证号">{{result.register.cardNumber}}</el-form-item>
      <el-form-item label="年龄">{{result.register.age}}</el-form-item>
      <el-form-item label="性别">{{result.register.gender}}</el-form-item>
    </el-form> <!--inline 表单内联-->
    <CheckTable :tableData="result.tableData" />
    <DrugTable style="margin-top: 20px" :tableData="drugTable" />
  </div>
</template>

<script setup >
import DoctorHeader from '@/components/doctor/header/index.vue';
import { ref, reactive } from 'vue'
import {get ,post} from '@/utils/axios'
import CheckTable from './checkTable'
import DrugTable from './drugTable'
const query = reactive({
  caseNumber: '',
  checkState:'已开立'
})
const result = reactive({
  register:{},
  checkData:[]
})
const drugTable = ref([])
function search(event){
  if(event.keyCode===13){ //回车键
    getTableData()
  }
}
function getTableData(){
  get('/checkRequest/list', query, content => {
    result.register = content.register
    result.tableData = content.checkRequestList
  })
  get('/prescription/list', query, content => {
    drugTable.value = content
    console.dir(content)
  })
}
</script>


<style lang='scss' scoped>
.ly-filter{
  margin-top: 20px;
}
</style>